<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>供给列表 - 社交市场</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #3b82f6;
            --primary-light: #60a5fa;
            --primary-dark: #2563eb;
            --secondary: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --text-tertiary: #94a3b8;
            --bg-light: #f8fafc;
            --bg-white: #ffffff;
            --bg-gray: #f1f5f9;
            --bg-gray-dark: #e2e8f0;
            --border-light: #e2e8f0;
            --border-medium: #cbd5e1;
            --radius: 12px;
            --radius-sm: 8px;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 60px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            border-bottom: 1px solid var(--border-light);
        }
        
        .nav-title {
            font-size: 1.1rem;
            font-weight: 600;
            text-align: center;
            flex: 1;
        }
        
        .nav-action {
            color: var(--text-secondary);
            background: none;
            border: none;
            font-size: 1.2rem;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .nav-action:hover {
            background-color: var(--bg-light);
        }
        
        .nav-action.primary {
            color: var(--primary);
        }
        
        /* 搜索栏 */
        .search-container {
            padding: 12px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .search-box {
            position: relative;
            background-color: var(--bg-gray);
            border-radius: 24px;
            padding: 8px 16px;
            display: flex;
            align-items: center;
        }
        
        .search-icon {
            color: var(--text-tertiary);
            font-size: 0.95rem;
            margin-right: 8px;
        }
        
        .search-input {
            flex: 1;
            background: none;
            border: none;
            outline: none;
            font-size: 0.9rem;
            color: var(--text-primary);
        }
        
        .search-input::placeholder {
            color: var(--text-tertiary);
        }
        
        /* 筛选栏 */
        .filters-bar {
            display: flex;
            padding: 8px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            overflow-x: auto;
            scrollbar-width: none;
            gap: 8px;
        }
        
        .filters-bar::-webkit-scrollbar {
            display: none;
        }
        
        .filter-item {
            white-space: nowrap;
            padding: 6px 12px;
            border-radius: 16px;
            font-size: 0.85rem;
            background-color: var(--bg-gray);
            color: var(--text-secondary);
            border: none;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .filter-item.active {
            background-color: var(--primary);
            color: white;
        }
        
        .filter-item .icon {
            font-size: 0.9rem;
        }
        
        /* 供给列表容器 */
        .supplies-container {
            padding: 12px 16px;
        }
        
        /* 供给卡片 - 通用样式 */
        .supply-card {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            overflow: hidden;
            margin-bottom: 16px;
            box-shadow: var(--shadow);
            text-decoration: none;
            color: var(--text-primary);
            transition: transform 0.2s ease;
        }
        
        .supply-card:hover {
            transform: translateY(-2px);
        }
        
        .supply-header {
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .provider-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background-color: var(--bg-gray);
            flex-shrink: 0;
            overflow: hidden;
        }
        
        .provider-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .provider-info {
            flex: 1;
        }
        
        .provider-name {
            font-weight: 600;
            font-size: 0.95rem;
            margin-bottom: 2px;
        }
        
        .supply-time {
            font-size: 0.75rem;
            color: var(--text-tertiary);
        }
        
        .verify-badge {
            color: var(--primary);
            font-size: 0.75rem;
            margin-left: 4px;
        }
        
        /* 供给内容区域 */
        .supply-content {
            padding: 0 16px 12px;
        }
        
        .supply-title {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 6px;
            color: var(--text-primary);
        }
        
        .supply-description {
            font-size: 0.9rem;
            color: var(--text-secondary);
            line-height: 1.5;
            margin-bottom: 8px;
        }
        
        /* 价格标签 */
        .price-tag {
            display: inline-block;
            padding: 3px 10px;
            background-color: rgba(16, 185, 129, 0.1);
            color: var(--secondary);
            border-radius: 4px;
            font-size: 0.8rem;
            font-weight: 500;
            margin-bottom: 10px;
        }
        
        /* 供给卡片 - 无图片样式 */
        .supply-no-image .supply-content {
            padding-bottom: 16px;
        }
        
        /* 供给卡片 - 单图片样式 */
        .supply-single-image .supply-image {
            width: 100%;
            height: 200px;
            position: relative;
            margin-bottom: 12px;
        }
        
        .supply-single-image .supply-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: var(--radius-sm);
        }
        
        /* 供给卡片 - 多图片样式 */
        .supply-multi-image .supply-images {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 4px;
            margin-bottom: 12px;
        }
        
        .supply-multi-image .supply-image {
            aspect-ratio: 1;
            position: relative;
        }
        
        .supply-multi-image .supply-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: var(--radius-sm);
        }
        
        .image-count-overlay {
            position: absolute;
            bottom: 4px;
            right: 4px;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            font-size: 0.7rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        /* 标签区域 */
        .tags-container {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-bottom: 10px;
        }
        
        .tag {
            background-color: var(--bg-gray);
            color: var(--text-secondary);
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 0.75rem;
        }
        
        /* 供给数据统计 */
        .supply-stats {
            display: flex;
            justify-content: space-between;
            padding: 8px 16px;
            border-top: 1px solid var(--border-light);
            font-size: 0.8rem;
            color: var(--text-tertiary);
        }
        
        .supply-stat-item {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .stat-value {
            font-weight: 600;
            color: var(--text-primary);
        }
        
        /* 行动按钮 */
        .supply-actions {
            display: flex;
            gap: 8px;
            padding: 0 16px 12px;
        }
        
        .supply-btn {
            flex: 1;
            padding: 8px;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 500;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        
        .primary-btn {
            background-color: var(--primary);
            color: white;
        }
        
        .secondary-btn {
            background-color: var(--bg-gray);
            color: var(--text-secondary);
        }
        
        /* 加载更多 */
        .load-more {
            padding: 16px 0;
            text-align: center;
        }
        
        .load-more-btn {
            background-color: var(--bg-white);
            border: 1px solid var(--border-light);
            color: var(--text-secondary);
            padding: 8px 24px;
            border-radius: 20px;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0 auto;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            gap: 4px;
            flex: 1;
            height: 100%;
            text-decoration: none;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        .nav-icon {
            font-size: 1.2rem;
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            z-index: 9999;
            font-size: 0.85rem;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
        
        /* 筛选抽屉 */
        .filter-drawer {
            position: fixed;
            top: 56px;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: var(--bg-white);
            z-index: 1010;
            transform: translateY(100%);
            transition: transform 0.3s ease;
            overflow-y: auto;
        }
        
        .filter-drawer.open {
            transform: translateY(0);
        }
        
        .drawer-header {
            padding: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border-light);
        }
        
        .drawer-title {
            font-size: 1.1rem;
            font-weight: 600;
        }
        
        .close-drawer {
            background: none;
            border: none;
            font-size: 1.2rem;
            color: var(--text-secondary);
        }
        
        .drawer-content {
            padding: 16px;
        }
        
        .filter-section {
            margin-bottom: 20px;
        }
        
        .filter-section-title {
            font-weight: 600;
            font-size: 0.95rem;
            margin-bottom: 12px;
            color: var(--text-primary);
        }
        
        .filter-options {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .filter-option {
            padding: 6px 14px;
            border-radius: 16px;
            font-size: 0.85rem;
            background-color: var(--bg-gray);
            color: var(--text-secondary);
            border: none;
        }
        
        .filter-option.active {
            background-color: var(--primary);
            color: white;
        }
        
        .drawer-actions {
            position: fixed;
            bottom: 60px;
            left: 0;
            right: 0;
            padding: 12px 16px;
            background-color: var(--bg-white);
            border-top: 1px solid var(--border-light);
            display: flex;
            gap: 12px;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-action" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">供给列表</div>
        <button class="nav-action primary" id="addSupplyBtn">
            <i class="fas fa-plus"></i>
        </button>
    </div>
    
    <!-- 搜索栏 -->
    <div class="search-container">
        <div class="search-box">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索供给物品、服务或提供者...">
        </div>
    </div>
    
    <!-- 筛选栏 -->
    <div class="filters-bar">
        <button class="filter-item active">
            <span>全部</span>
        </button>
        <button class="filter-item">
            <i class="fas fa-shopping-bag icon"></i>
            <span>物品</span>
        </button>
        <button class="filter-item">
            <i class="fas fa-hand-holding-heart icon"></i>
            <span>服务</span>
        </button>
        <button class="filter-item">
            <i class="fas fa-clock icon"></i>
            <span>最新发布</span>
        </button>
        <button class="filter-item">
            <i class="fas fa-fire icon"></i>
            <span>热门推荐</span>
        </button>
        <button class="filter-item" id="moreFiltersBtn">
            <i class="fas fa-sliders icon"></i>
            <span>更多筛选</span>
        </button>
    </div>
    
    <!-- 供给列表容器 -->
    <div class="supplies-container">
        <!-- 供给卡片 - 多图片样式 -->
        <div class="supply-card supply-multi-image">
            <div class="supply-header">
                <div class="provider-avatar">
                    <img src="https://picsum.photos/id/64/100/100" alt="用户头像">
                </div>
                <div class="provider-info">
                    <div class="provider-name">
                        张小明 <i class="fas fa-check-circle verify-badge"></i>
                    </div>
                    <div class="supply-time">2小时前</div>
                </div>
            </div>
            <div class="supply-content">
                <div class="supply-title">闲置数码产品转让</div>
                <div class="supply-description">
                    转让一批闲置数码产品，包括笔记本电脑、平板电脑和无线耳机，均为9成新，功能完好，价格可议。
                </div>
                <div class="price-tag">¥1000-3500</div>
                <div class="tags-container">
                    <span class="tag">数码产品</span>
                    <span class="tag">闲置转让</span>
                    <span class="tag">可议价</span>
                </div>
                <div class="supply-images">
                    <div class="supply-image">
                        <img src="https://picsum.photos/id/48/300/300" alt="笔记本电脑">
                    </div>
                    <div class="supply-image">
                        <img src="https://picsum.photos/id/160/300/300" alt="平板电脑">
                    </div>
                    <div class="supply-image">
                        <img src="https://picsum.photos/id/96/300/300" alt="无线耳机">
                    </div>
                </div>
            </div>
            <div class="supply-stats">
                <div class="supply-stat-item">
                    <i class="far fa-eye"></i>
                    <span class="stat-value">156</span>
                    <span>浏览</span>
                </div>
                <div class="supply-stat-item">
                    <i class="far fa-comment"></i>
                    <span class="stat-value">24</span>
                    <span>咨询</span>
                </div>
                <div class="supply-stat-item">
                    <i class="fas fa-map-marker-alt"></i>
                    <span>3.2km</span>
                </div>
            </div>
            <div class="supply-actions">
                <button class="supply-btn primary-btn">
                    <i class="fas fa-comment"></i>
                    <span>联系咨询</span>
                </button>
                <button class="supply-btn secondary-btn">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
        
        <!-- 供给卡片 - 单图片样式 -->
        <div class="supply-card supply-single-image">
            <div class="supply-header">
                <div class="provider-avatar">
                    <img src="https://picsum.photos/id/65/100/100" alt="用户头像">
                </div>
                <div class="provider-info">
                    <div class="provider-name">
                        李华 <i class="fas fa-check-circle verify-badge"></i>
                    </div>
                    <div class="supply-time">昨天 14:30</div>
                </div>
            </div>
            <div class="supply-content">
                <div class="supply-title">周末摄影服务提供</div>
                <div class="supply-description">
                    专业摄影师提供周末人像摄影服务，包含精修15张照片，可拍摄个人写真、情侣照或家庭照，需提前预约。
                </div>
                <div class="price-tag">¥599/次</div>
                <div class="tags-container">
                    <span class="tag">摄影服务</span>
                    <span class="tag">周末可用</span>
                    <span class="tag">需预约</span>
                </div>
                <div class="supply-image">
                    <img src="https://picsum.photos/id/237/600/400" alt="摄影作品示例">
                </div>
            </div>
            <div class="supply-stats">
                <div class="supply-stat-item">
                    <i class="far fa-eye"></i>
                    <span class="stat-value">218</span>
                    <span>浏览</span>
                </div>
                <div class="supply-stat-item">
                    <i class="far fa-comment"></i>
                    <span class="stat-value">37</span>
                    <span>咨询</span>
                </div>
                <div class="supply-stat-item">
                    <i class="fas fa-map-marker-alt"></i>
                    <span>5.7km</span>
                </div>
            </div>
            <div class="supply-actions">
                <button class="supply-btn primary-btn">
                    <i class="fas fa-comment"></i>
                    <span>联系咨询</span>
                </button>
                <button class="supply-btn secondary-btn">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
        
        <!-- 供给卡片 - 无图片样式 -->
        <div class="supply-card supply-no-image">
            <div class="supply-header">
                <div class="provider-avatar">
                    <img src="https://picsum.photos/id/22/100/100" alt="用户头像">
                </div>
                <div class="provider-info">
                    <div class="provider-name">
                        王芳
                    </div>
                    <div class="supply-time">3天前</div>
                </div>
            </div>
            <div class="supply-content">
                <div class="supply-title">英语家教服务</div>
                <div class="supply-description">
                    英语专业研究生提供中小学英语家教服务，有3年教学经验，擅长口语和应试辅导，可上门或线上教学，价格根据年级而定。
                </div>
                <div class="price-tag">¥80-150/小时</div>
                <div class="tags-container">
                    <span class="tag">教育培训</span>
                    <span class="tag">英语家教</span>
                    <span class="tag">线上线下</span>
                </div>
            </div>
            <div class="supply-stats">
                <div class="supply-stat-item">
                    <i class="far fa-eye"></i>
                    <span class="stat-value">324</span>
                    <span>浏览</span>
                </div>
                <div class="supply-stat-item">
                    <i class="far fa-comment"></i>
                    <span class="stat-value">42</span>
                    <span>咨询</span>
                </div>
                <div class="supply-stat-item">
                    <i class="fas fa-map-marker-alt"></i>
                    <span>2.8km</span>
                </div>
            </div>
            <div class="supply-actions">
                <button class="supply-btn primary-btn">
                    <i class="fas fa-comment"></i>
                    <span>联系咨询</span>
                </button>
                <button class="supply-btn secondary-btn">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
        
        <!-- 供给卡片 - 多图片带数量样式 -->
        <div class="supply-card supply-multi-image">
            <div class="supply-header">
                <div class="provider-avatar">
                    <img src="https://picsum.photos/id/91/100/100" alt="用户头像">
                </div>
                <div class="provider-info">
                    <div class="provider-name">
                        陈明 <i class="fas fa-check-circle verify-badge"></i>
                    </div>
                    <div class="supply-time">1周前</div>
                </div>
            </div>
            <div class="supply-content">
                <div class="supply-title">二手家具清仓处理</div>
                <div class="supply-description">
                    搬家清仓处理各种家具，包括沙发、餐桌、床架和衣柜等，均为实木材质，使用不到2年，欢迎上门挑选。
                </div>
                <div class="price-tag">¥200-1500</div>
                <div class="tags-container">
                    <span class="tag">二手家具</span>
                    <span class="tag">清仓处理</span>
                    <span class="tag">自提</span>
                </div>
                <div class="supply-images">
                    <div class="supply-image">
                        <img src="https://picsum.photos/id/174/300/300" alt="沙发">
                    </div>
                    <div class="supply-image">
                        <img src="https://picsum.photos/id/183/300/300" alt="餐桌">
                    </div>
                    <div class="supply-image">
                        <img src="https://picsum.photos/id/177/300/300" alt="床架">
                        <div class="image-count-overlay">+5</div>
                    </div>
                </div>
            </div>
            <div class="supply-stats">
                <div class="supply-stat-item">
                    <i class="far fa-eye"></i>
                    <span class="stat-value">452</span>
                    <span>浏览</span>
                </div>
                <div class="supply-stat-item">
                    <i class="far fa-comment"></i>
                    <span class="stat-value">68</span>
                    <span>咨询</span>
                </div>
                <div class="supply-stat-item">
                    <i class="fas fa-map-marker-alt"></i>
                    <span>7.5km</span>
                </div>
            </div>
            <div class="supply-actions">
                <button class="supply-btn primary-btn">
                    <i class="fas fa-comment"></i>
                    <span>联系咨询</span>
                </button>
                <button class="supply-btn secondary-btn">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
    </div>
    
    <!-- 加载更多 -->
    <div class="load-more">
        <button class="load-more-btn" id="loadMoreBtn">
            <i class="fas fa-spinner fa-spin" style="display: none;"></i>
            <span>加载更多</span>
        </button>
    </div>
    
    <!-- 筛选抽屉 -->
    <div class="filter-drawer" id="filterDrawer">
        <div class="drawer-header">
            <div class="drawer-title">更多筛选</div>
            <button class="close-drawer" id="closeDrawer">
                <i class="fas fa-times"></i>
            </button>
        </div>
        <div class="drawer-content">
            <!-- 价格范围筛选 -->
            <div class="filter-section">
                <div class="filter-section-title">价格范围</div>
                <div class="filter-options">
                    <button class="filter-option">全部价格</button>
                    <button class="filter-option">¥0-100</button>
                    <button class="filter-option active">¥100-500</button>
                    <button class="filter-option">¥500-1000</button>
                    <button class="filter-option">¥1000以上</button>
                </div>
            </div>
            
            <!-- 距离筛选 -->
            <div class="filter-section">
                <div class="filter-section-title">距离范围</div>
                <div class="filter-options">
                    <button class="filter-option active">全部距离</button>
                    <button class="filter-option">1km以内</button>
                    <button class="filter-option">3km以内</button>
                    <button class="filter-option">5km以内</button>
                    <button class="filter-option">10km以内</button>
                </div>
            </div>
            
            <!-- 供给状态筛选 -->
            <div class="filter-section">
                <div class="filter-section-title">供给状态</div>
                <div class="filter-options">
                    <button class="filter-option active">全部状态</button>
                    <button class="filter-option">可立即提供</button>
                    <button class="filter-option">需提前预约</button>
                </div>
            </div>
            
            <!-- 分类筛选 -->
            <div class="filter-section">
                <div class="filter-section-title">详细分类</div>
                <div class="filter-options">
                    <button class="filter-option active">全部分类</button>
                    <button class="filter-option">电子数码</button>
                    <button class="filter-option">家居用品</button>
                    <button class="filter-option">服装服饰</button>
                    <button class="filter-option">教育培训</button>
                    <button class="filter-option">休闲娱乐</button>
                    <button class="filter-option">生活服务</button>
                    <button class="filter-option">运动健康</button>
                </div>
            </div>
        </div>
        <div class="drawer-actions">
            <button class="supply-btn secondary-btn" id="resetFiltersBtn">
                <i class="fas fa-sync-alt"></i>
                <span>重置</span>
            </button>
            <button class="supply-btn primary-btn" id="applyFiltersBtn">
                <i class="fas fa-check"></i>
                <span>应用筛选</span>
            </button>
        </div>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home nav-icon"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-compass nav-icon"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-box-open nav-icon"></i>
            <span>供给</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-bell nav-icon"></i>
            <span>通知</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user nav-icon"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 提示消息元素 -->
    <div class="toast" id="toast"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById('backBtn');
        const addSupplyBtn = document.getElementById('addSupplyBtn');
        const filterItems = document.querySelectorAll('.filter-item');
        const moreFiltersBtn = document.getElementById('moreFiltersBtn');
        const filterDrawer = document.getElementById('filterDrawer');
        const closeDrawerBtn = document.getElementById('closeDrawer');
        const resetFiltersBtn = document.getElementById('resetFiltersBtn');
        const applyFiltersBtn = document.getElementById('applyFiltersBtn');
        const filterOptions = document.querySelectorAll('.filter-option');
        const loadMoreBtn = document.getElementById('loadMoreBtn');
        const supplyBtns = document.querySelectorAll('.supply-btn');
        const navItems = document.querySelectorAll('.nav-item');
        
        // 筛选栏按钮切换
        filterItems.forEach(item => {
            item.addEventListener('click', function() {
                // 如果点击的是"更多筛选"，则打开筛选抽屉
                if (this.id === 'moreFiltersBtn') {
                    filterDrawer.classList.add('open');
                    return;
                }
                
                // 否则切换活跃状态
                filterItems.forEach(i => i.classList.remove('active'));
                this.classList.add('active');
                showToast(`已切换到${this.querySelector('span').textContent}`);
            });
        });
        
        // 筛选抽屉控制
        moreFiltersBtn.addEventListener('click', function() {
            filterDrawer.classList.add('open');
        });
        
        closeDrawerBtn.addEventListener('click', function() {
            filterDrawer.classList.remove('open');
        });
        
        // 筛选选项切换
        filterOptions.forEach(option => {
            option.addEventListener('click', function() {
                // 找到同一组的所有选项
                const parent = this.parentElement;
                parent.querySelectorAll('.filter-option').forEach(opt => {
                    opt.classList.remove('active');
                });
                
                // 激活当前选项
                this.classList.add('active');
            });
        });
        
        // 重置筛选条件
        resetFiltersBtn.addEventListener('click', function() {
            filterOptions.forEach(option => {
                option.classList.remove('active');
                // 激活每个组的第一个选项（"全部"）
                if (option.parentElement.querySelector('.filter-option:first-child') === option) {
                    option.classList.add('active');
                }
            });
            showToast('已重置筛选条件');
        });
        
        // 应用筛选条件
        applyFiltersBtn.addEventListener('click', function() {
            filterDrawer.classList.remove('open');
            
            // 收集选中的筛选条件
            const activeFilters = [];
            document.querySelectorAll('.filter-option.active').forEach(option => {
                if (!option.textContent.includes('全部')) {
                    activeFilters.push(option.textContent);
                }
            });
            
            if (activeFilters.length > 0) {
                showToast(`已应用筛选: ${activeFilters.join(', ')}`);
            } else {
                showToast('已应用默认筛选');
            }
        });
        
        // 加载更多
        loadMoreBtn.addEventListener('click', function() {
            const spinner = this.querySelector('.fa-spinner');
            const text = this.querySelector('span');
            const originalText = text.textContent;
            
            spinner.style.display = 'inline-block';
            text.textContent = '加载中...';
            this.disabled = true;
            
            setTimeout(() => {
                spinner.style.display = 'none';
                text.textContent = originalText;
                this.disabled = false;
                showToast('已加载更多供给信息');
            }, 1500);
        });
        
        // 供给卡片操作按钮
        supplyBtns.forEach(btn => {
            btn.addEventListener('click', function() {
                const actionText = this.querySelector('span').textContent;
                const supplyTitle = this.closest('.supply-card').querySelector('.supply-title').textContent;
                
                if (actionText === '收藏') {
                    // 切换收藏状态
                    const icon = this.querySelector('i');
                    if (icon.classList.contains('far')) {
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        showToast(`已收藏: ${supplyTitle}`);
                    } else {
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        showToast(`已取消收藏: ${supplyTitle}`);
                    }
                } else {
                    showToast(`${actionText}: ${supplyTitle}`);
                }
            });
        });
        
        // 其他按钮事件
        backBtn.addEventListener('click', function() {
            history.back();
        });
        
        addSupplyBtn.addEventListener('click', function() {
            showToast('发布新供给页面已打开');
        });
        
        // 底部导航点击
        navItems.forEach(item => {
            item.addEventListener('click', function(e) {
                e.preventDefault();
                navItems.forEach(i => i.classList.remove('active'));
                this.classList.add('active');
                const title = this.querySelector('span').textContent;
                showToast(`已切换到${title}`);
            });
        });
        
        // 提示消息功能
        function showToast(message) {
            const toast = document.getElementById('toast');
            toast.textContent = message;
            toast.classList.add('show');
            
            setTimeout(() => {
                toast.classList.remove('show');
            }, 2000);
        }
    </script>
</body>
</html>


